#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

struct test
{
	char a1;
	char b2;
	int i;
};

#define OFFSETOF(struct_name,member_name) (int)&(((struct_name*)0)->member_name)-0

int main()
{
	printf("%d\n", OFFSETOF(struct test, a1));
	printf("%d\n", OFFSETOF(struct test, b2));
	printf("%d\n", OFFSETOF(struct test, i));
	return 0;
}